package com.example.activemq;

import org.apache.activemq.command.ActiveMQTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

@Component
public class ProducerTopic {

    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    public void send(String msg) {
        this.jmsMessagingTemplate.convertAndSend(new ActiveMQTopic(
                "sample.topic"), msg);
    }

}